#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
    int a, b, c;
    float cost = 0.0f;
    float ys = 0.0f;
    scanf("%f %d %d %d", &cost, &a, &b, &c);
    if (a == 11 && b == 11)
    {
        cost = cost * 0.7;
        if (c == 1)
        {
            cost = cost - 50;
        }
    }
    if (a == 12 && b == 12)
    {
        cost = cost * 0.8;
        if (c == 1)
        {
            cost = cost - 50;
        }
    }
    printf("%.2f", (cost > 0 ? cost : 0.0));


    return 0;
}#include <stdio.h>

int main()
{
    int i = 0;
    int j = 0;
    int a, b;

    for (i = 10000; i < 100000; i++)
    {
        int count = 0;
        for (j = 10; j < 10001; j = j * 10)
        {
            a = i / j;
            b = i % j;
            count = count + a * b;

        }
        if (count == i)
            printf("%d ", i);

    }


    return 0;
}